//
//  SwiftConstant.swift
//  MuYing
//
//  Created by tbb on 2019/7/19.
//  Copyright © 2019 TBB. All rights reserved.
//

import Foundation

//机型适配
let IS_IPHONE4 =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 640, height: 960).equalTo((UIScreen.main.currentMode?.size)!) : false)

let IS_IPHONE5 =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 640, height: 1136).equalTo((UIScreen.main.currentMode?.size)!) : false)

let IS_IPHONE6 =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 750, height: 1334).equalTo((UIScreen.main.currentMode?.size)!) : false)

let IS_IPHONE6_PLUS =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 1242, height: 2208).equalTo((UIScreen.main.currentMode?.size)!) : false)


let IS_IPHONE_XOrXs =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 1125, height: 2436).equalTo((UIScreen.main.currentMode?.size)!) : false);

let IS_IPHONE_XR =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 828, height: 1792).equalTo((UIScreen.main.currentMode?.size)!) : false);

let IS_IPHONE_XSMAX =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 1242, height: 2688).equalTo((UIScreen.main.currentMode?.size)!) : false);
//x系列
let IS_ALL_IPHONE_Xs = (IS_IPHONE_XOrXs || IS_IPHONE_XR || IS_IPHONE_XSMAX)


let kNavigationBarHeight:CGFloat = IS_ALL_IPHONE_Xs ? 88 : 64;
let kBottomToolBarHeight:CGFloat = IS_ALL_IPHONE_Xs ? 83.0 : 49;

let kMU_Height_StatusBar:CGFloat = IS_ALL_IPHONE_Xs ? 44.0 : 22.0;
let kHeight_Botton_SafeArea:CGFloat = IS_ALL_IPHONE_Xs ? 34.0 : 0;

let kSwiftkScreenSize:CGSize = UIScreen.main.bounds.size;

let kSwiftkScreenSizeWidth = kSwiftkScreenSize.width;
let kSwiftkScreenSizeHeight = kSwiftkScreenSize.height;

let kSwiftAPPSCALEW:CGFloat = kSwiftkScreenSizeWidth / 375.0;
let kSwiftAPPSCALEH:CGFloat = kSwiftkScreenSizeHeight / 667.0;

public func kappWidthScale(_ w:CGFloat) -> CGFloat {
    return w * kSwiftAPPSCALEW;
}

public func kappHeightScale(_ h:CGFloat) -> CGFloat {
    return h * kSwiftAPPSCALEH;
}

public func kappFontScale(_ size:CGFloat) -> CGFloat {
    if kSwiftkScreenSizeWidth == 320  {
        return size - 1;
    }else if(kSwiftkScreenSizeWidth == 375) {
        return size;
    }else{
        return size + 1;
    }
}

//机型适配 end
//国际化
public func kYQLSSwift(_ key:String) -> String {
    return NSLocalizedString(key, comment: "")
}

